package cn.iutils.faq.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.iutils.common.service.CrudService;
import cn.iutils.faq.dao.QuestionsDao;
import cn.iutils.faq.entity.Questions;

import java.util.List;

/**
* 问题表 Service层
* @author iutils.cn
* @version 1.0
*/
@Service
@Transactional(readOnly = true)
public class QuestionsService extends CrudService<QuestionsDao, Questions> {

    /**
     * 查看数+1
     * @param id
     * @return
     */
    @Transactional(readOnly = false)
    public int plusViews(String id){
        return dao.plusViews(id);
    }

    /**
     * 获取热门问题列表
     * @param size
     * @return
     */
    public List<Questions> findHotList(int size){
        return dao.findHotList(size);
    }
}
